﻿using System;
using System.Net.Mail;

namespace Realtors.Web.UI.Infrastructure
{
    public class MailService : IMailService
    {
        private string _emailTo;

        public MailService(string  emailTo)
        {
            emailTo = _emailTo;
        }
        public bool Send(string from, string subject, string body)
        {
            try
            {
                var msg = new MailMessage(from, _emailTo, subject, body);
                var client = new SmtpClient();
                client.Send(msg);
            }
            catch (Exception ex)
            {
                return false;
            }
            return true;
        }
    }
}